Utility Functions
This section describes a number of utility functions that may be supported by some video digitizer components.
The
VDSetPLLFilterType
and
VDGetPLLFilterType
functions allow applications to control which
phase-locked loop (PLL)
is used by a video digitizer component that supports multiple PLLs.
The
VDSetFieldPreference
and
VDGetFieldPreference
functions allow applications to control which field is used for some vertical scaling operations.
The
VDSetDigitizerUserInterrupt
function allows applications to install custom interrupt functions that are called by the video digitizer component.
The
VDGetSoundInputDriver
function allows an application to retrieve information about a digitizer's sound input driver.
The
VDGetPreferredTimeScale
function allows an application to determine a digitizer's preferred time scale.
VDSetPLLFilterType
The
VDSetPLLFilterType
function allows applications to specify which PLL is to be active.
pascal VideoDigitizerError VDSetPLLFilterType
(VideoDigitizerComponent ci,
short pllType);
-
ci
-
Specifies the video digitizer component for the request. Applications obtain this reference from the Component Manager's
OpenComponent
function.
-
pllType
-
Indicates which PLL is to be active. Available values are
-
0
-
Broadcast mode
-
1
-
VTR mode (stands for video tape recorder--equivalent to VCR, which stands for video cassette recorder)
RESULT CODES
noErr
|
0
|
No error
|
digiUnimpErr
|
-2201
|
Function not supported
|
qtParamErr
|
-2202
|
Invalid parameter value
|
SEE ALSO
Applications can get the active PLL type by calling the
VDGetPLLFilterType
function, which is described in the next section.
VDGetPLLFilterType
The
VDGetPLLFilterType
function allows applications to determine which PLL is currently active.
pascal VideoDigitizerError VDGetPLLFilterType
(VideoDigitizerComponent ci,
short *pllType);
-
ci
-
Specifies the video digitizer component for the request. Applications obtain this reference from the Component Manager's
OpenComponent
function.
-
pllType
-
Points to a field that is to receive a value indicating which PLL is active. Available values are
-
0
-
Broadcast mode
-
1
-
VTR mode
RESULT CODES
noErr
|
0
|
No error
|
digiUnimpErr
|
-2201
|
Function not supported
|
qtParamErr
|
-2202
|
Invalid parameter value
|
SEE ALSO
Applications can set the PLL type by calling the
VDSetPLLFilterType
function, which is described in the previous section.
VDSetFieldPreference
The
VDSetFieldPreference
function allows applications to specify which field to use in cases where the vertical scaling is less than half size.
All video digitizer components must support this function.
pascal VideoDigitizerError VDSetFieldPreference
(VideoDigitizerComponent ci,
short fieldFlag);
-
ci
-
Specifies the video digitizer component for the request. Applications obtain this reference from the Component Manager's
OpenComponent
function.
-
fieldFlag
-
Indicates which field to use. Valid values are
-
vdUseAnyField
-
Digitizer component decides which field to use
-
vdUseOddField
-
Digitizer uses odd field
-
vdUseEvenField
-
Digitizer uses even field
DESCRIPTION
Applications can specify that the digitizer use either the odd-line field or the even-line field; alternatively, applications can let the component decide which field to use.
RESULT CODES
noErr
|
0
|
No error
|
qtParamErr
|
-2202
|
Invalid parameter value
|
VDGetFieldPreference
The
VDGetFieldPreference
function allows applications to determine which field is being used in cases where the image is vertically scaled to half its original size.
pascal VideoDigitizerError VDGetFieldPreference
(VideoDigitizerComponent ci,
short *fieldFlag);
-
ci
-
Specifies the video digitizer component for the request. Applications obtain this reference from the Component Manager's
OpenComponent
function.
-
fieldFlag
-
Points to a field that is to receive a value indicating which field is being used. Valid values are
-
vdUseAnyField
-
Digitizer component decides which field to use
-
vdUseOddField
-
Digitizer component uses odd field
-
vdUseEvenField
-
Digitizer component uses even field
DESCRIPTION
Video digitizer components can use either the odd-line field or the even-line field. All video digitizer components must support this function.
RESULT CODES
noErr
|
0
|
No error
|
qtParamErr
|
-2202
|
Invalid parameter value
|
VDSetDigitizerUserInterrupt
The
VDSetDigitizerUserInterrupt
function allows applications to set custom interrupt functions.
pascal VideoDigitizerError VDSetDigitizerUserInterrupt
(VideoDigitizerComponent ci,
long flags,
VdigIntUPP userInterruptProc,
long refcon);
-
ci
-
Specifies the video digitizer component for the request. Applications obtain this reference from the Component Manager's
OpenComponent
function.
-
flags
-
Indicates when the interrupt function is to be called. Applications may set more than one flag to 1. The following flags are defined:
-
Bit 0
-
Calls the interrupt function on even-line fields. If this flag is set to 1, the video digitizer component calls the custom interrupt procedure each time it starts to display an even-line field.
-
Bit 1
-
Calls the interrupt function on odd-line fields. If this flag is set to 1, the video digitizer component calls the custom interrupt procedure each time it starts to display an odd-line field.
-
userInterruptProc
-
Contains a pointer to the custom interrupt function. Applications set this parameter to
nil
to remove a custom interrupt function.
-
Every custom interrupt function must support the following interface:
pascal void MyInterruptProc (long flags, long refcon);
-
See
Application-Defined Function
for details on the parameters of the
MyInterruptProc
function.
-
refcon
-
Contains parameter data that is appropriate for the interrupt procedure.
DESCRIPTION
The video digitizer component calls these custom interrupt functions during field or frame interrupt processing. The application function can then perform special processing.
RESULT CODES
noErr
|
0
|
No error
|
digiUnimpErr
|
-2201
|
Function not supported
|
VDGetSoundInputDriver
The
VDGetSoundInputDriver
function allows an application to retrieve information about a digitizer's sound input driver.
pascal VideoDigitizerError VDGetSoundInputDriver
(VideoDigitizerComponent ci,
Str255 soundDriverName);
-
ci
-
Identifies the application's connection to the video digitizer component. An application obtains this value from the Component Manager's
OpenComponent
function.
-
soundDriverName
-
Specifies a pointer to a string. The video digitizer returns the name of its sound input driver. If the digitizer does not have an associated driver, it returns a result code of
digiUnimpErr
.
DESCRIPTION
An application can use the driver name returned by this function to choose an appropriate sound input device to use with this digitizer.
RESULT CODES
noErr
|
0
|
No error
|
qtParamErr
|
-2202
|
Invalid parameter value
|
VDGetPreferredTimeScale
The
VDGetPreferredTimeScale
function allows an application to determine a digitizer's preferred time scale.
pascal VideoDigitizerError VDGetPreferredTimeScale
(VideoDigitizerComponent ci,
TimeScale *preferred);
-
ci
-
Identifies the application's connection to the video digitizer component. An application obtains this value from the Component Manager's
OpenComponent
function.
-
preferred
-
Contains a pointer to a time scale structure. The video digitizer returns information about its preferred time scale.
DESCRIPTION
Apple's sequence grabber component uses this function to establish the time scale of the media that it creates from the digitizer's output. This is especially beneficial for digitizers that return compressed data, because it allows these digitizers to timestamp the frames very accurately.
If the digitizer does not have a preferred time scale, it returns a result code of
digiUnimpErr
.
RESULT CODES
noErr
|
0
|
No error
|
qtParamErr
|
-2202
|
Invalid parameter value
|
© 1997 Apple Computer, Inc.Previous | Chapter Top | Chapter Contents | Next